Skip to content

Comments

fix the unstable socket connection error#116

Open
ababycat wants to merge 1 commit intoTencent:masterfrom
ababycat:master
Open

fix the unstable socket connection error#116
ababycat wants to merge 1 commit intoTencent:masterfrom
ababycat:master

Conversation

@ababycat
Copy link

@ababycat ababycat commented Apr 23, 2023

If notify_one() of the condition variable has been called before the function wait(), wait() blocks the connection until the next connection is established.

So you get an socket connect Error. #102 etc. It will occur more frequently on the iOS platform.

solution:
Use FScopedEvent of UE to synchronize the finished status.

reference:

https://en.cppreference.com/w/cpp/thread/condition_variable/notify_one
https://docs.unrealengine.com/4.26/en-US/API/Runtime/Core/Misc/FScopedEvent/

If notify_one() of the condition variable has been called before the function wait(), wait()  blocks the connection until the next connection is established. 

So you get an socket connect Error.  It will occur more frequently on the iOS platform.

solution:
Use FScopedEvent of UE.

reference: 
https://en.cppreference.com/w/cpp/thread/condition_variable/notify_one
https://docs.unrealengine.com/4.26/en-US/API/Runtime/Core/Misc/FScopedEvent/
@tencent-adm
Copy link
Member

tencent-adm commented Apr 23, 2023

CLA assistant check
All committers have signed the CLA.

@ababycat ababycat changed the title fix the unstable socket connection error fix the unstable socket connection error #102 Apr 23, 2023
@ababycat ababycat changed the title fix the unstable socket connection error #102 fix the unstable socket connection error Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants